package com.lance.answer.gui.answer.gk.answer.lms;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.lance.answer.gui.answer.Question;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.jetbrains.annotations.NotNull;

import java.util.List;

/**
 * <p>一网一平台的视频信息<p>
 *
 * @author : fengx
 * @since JDK8.0
 * create by fengx on 2022/4/19 11:04
 */
@NoArgsConstructor
@Data
public class LmsOuchnVideoInfo {
    @JsonProperty("activity_reads")
    private List<ActivityReadsDTO> activityReads;

    @NoArgsConstructor
    @Data
    public static class ActivityReadsDTO  implements Comparable<ActivityReadsDTO>  {
        @JsonProperty("activity_id")
        // 单个视频的ID "activity_id":1507616,
        private Integer activityId;
        // 视频的类型 ： "activity_type":"learning_activity",
        /**
         * "activityType":"exam_activity"
         * 观看视频的时候要过滤掉"exam_activity"类型的数据  好像这个是作业链接的ID
         */
        @JsonProperty("activity_type")
        private String activityType;
        /**
         * 完成度 如果是full，代表已经完成 part就是部分
         * "completeness":"full",
         * completeness":"part",
         * */
        /**
         * {"activityId":1508701,"activityType":"learning_activity","completeness":"part","createdById":1382127,"createdForId":1382127,"data":{"completeness":2,"end":7,"ranges":[[0,7]]},"id":70890201,"lastVisitedAt":"2022-04-19T02:24:08Z"}
         * {"activityId":1508770,"activityType":"learning_activity","completeness":"part","createdById":1382127,"createdForId":1382127,"data":{},"id":66927847,"lastVisitedAt":"2022-04-18T07:46:44Z"}
         */
        @JsonProperty("completeness")
        private String completeness;
        @JsonProperty("created_by_id")
        private Integer createdById;
        @JsonProperty("created_for_id")
        private Integer createdForId;
        // 视频的相关信息
        @JsonProperty("data")
        private DataDTO data;
        @JsonProperty("id")
        private Integer id;
        @JsonProperty("last_visited_at")
        private String lastVisitedAt;

        @NoArgsConstructor
        @Data
        public static class DataDTO {
            // 单个视频完成度？百分比来计算  completeness "completeness":100,
            @JsonProperty("completeness")
            private Integer completeness;
            @JsonProperty("end")
            // 好像是视频已经完成的长度？？？？？ "end":475,
            private Integer end;
            /**视频可以拉伸的长度  如果没有点击过，就是NULL
             * "ranges":[
             * [0,475]
             * ]
             * }
             */
            @JsonProperty("ranges")
            private List<List<Integer>> ranges;
        }


        @Override
        public int compareTo(@NotNull ActivityReadsDTO o) {
            return Integer.compare(this.activityId,o.activityId);
        }

    }



    /**
     * {"activity_reads":[{"activity_id":1507616,"activity_type":"learning_activity","completeness":"part","created_by_id":1382127,"created_for_id":1382127,"data":{"completeness":100,"end":475,"ranges":[[0,475]]},"id":70040560,"last_visited_at":"2022-04-19T02:32:10Z"},{"activity_id":1507627,"activity_type":"learning_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{"completeness":100,"end":452,"ranges":[[0,452]]},"id":70046543,"last_visited_at":"2022-04-19T02:32:09Z"},{"activity_id":1508695,"activity_type":"learning_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{"completeness":100,"end":329,"ranges":[[0,329]]},"id":70321502,"last_visited_at":"2022-04-19T02:27:48Z"},{"activity_id":1508701,"activity_type":"learning_activity","completeness":"part","created_by_id":1382127,"created_for_id":1382127,"data":{"completeness":2,"end":7,"ranges":[[0,7]]},"id":70890201,"last_visited_at":"2022-04-19T02:24:08Z"},{"activity_id":1508680,"activity_type":"learning_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{"completeness":100,"end":449,"ranges":[[0,449]]},"id":70215356,"last_visited_at":"2022-04-19T02:12:05Z"},{"activity_id":1507633,"activity_type":"learning_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{"completeness":100,"end":440,"ranges":[[0,440]]},"id":70055100,"last_visited_at":"2022-04-18T14:58:39Z"},{"activity_id":1507624,"activity_type":"learning_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{},"id":70046447,"last_visited_at":"2022-04-18T14:58:23Z"},{"activity_id":1507606,"activity_type":"learning_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{"completeness":100,"end":450,"ranges":[[0,450]]},"id":70034195,"last_visited_at":"2022-04-18T14:58:22Z"},{"activity_id":1507597,"activity_type":"learning_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{"completeness":100,"end":420,"ranges":[[0,420]]},"id":70019255,"last_visited_at":"2022-04-18T14:58:16Z"},{"activity_id":1507780,"activity_type":"learning_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{"completeness":100,"end":386,"ranges":[[0,386]]},"id":70529222,"last_visited_at":"2022-04-18T09:01:23Z"},{"activity_id":1507771,"activity_type":"learning_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{"completeness":100,"end":417,"ranges":[[0,417]]},"id":70459626,"last_visited_at":"2022-04-18T08:58:05Z"},{"activity_id":1507759,"activity_type":"learning_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{"completeness":100,"end":411,"ranges":[[0,411]]},"id":70430831,"last_visited_at":"2022-04-18T08:06:39Z"},{"activity_id":1507753,"activity_type":"learning_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{"completeness":100,"end":435,"ranges":[[0,435]]},"id":70424634,"last_visited_at":"2022-04-18T07:48:03Z"},{"activity_id":1508770,"activity_type":"learning_activity","completeness":"part","created_by_id":1382127,"created_for_id":1382127,"data":{},"id":66927847,"last_visited_at":"2022-04-18T07:46:44Z"},{"activity_id":1507745,"activity_type":"learning_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{"completeness":100,"end":404,"ranges":[[0,404]]},"id":70390338,"last_visited_at":"2022-04-18T07:44:12Z"},{"activity_id":1507734,"activity_type":"learning_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{"completeness":100,"end":309,"ranges":[[0,309]]},"id":70141595,"last_visited_at":"2022-04-18T07:22:28Z"},{"activity_id":1508688,"activity_type":"learning_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{"completeness":100,"end":71,"ranges":[[0,390]]},"id":70224903,"last_visited_at":"2022-04-18T06:34:20Z"},{"activity_id":1508980,"activity_type":"learning_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{},"id":70296948,"last_visited_at":"2022-04-18T06:13:37Z"},{"activity_id":1508782,"activity_type":"learning_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{},"id":67262173,"last_visited_at":"2022-04-18T06:13:07Z"},{"activity_id":1508670,"activity_type":"learning_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{"completeness":100,"end":240,"ranges":[[0,366]]},"id":70205090,"last_visited_at":"2022-04-18T04:55:42Z"},{"activity_id":1508663,"activity_type":"learning_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{"completeness":100,"end":371,"ranges":[[0,371]]},"id":70105885,"last_visited_at":"2022-04-18T04:52:35Z"},{"activity_id":1507727,"activity_type":"learning_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{"completeness":100,"end":405,"ranges":[[0,405]]},"id":70130088,"last_visited_at":"2022-04-18T03:41:23Z"},{"activity_id":1507719,"activity_type":"learning_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{"completeness":100,"end":440,"ranges":[[0,440]]},"id":68956656,"last_visited_at":"2022-04-18T03:30:46Z"},{"activity_id":1507521,"activity_type":"learning_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{"completeness":100,"end":418,"ranges":[[0,418]]},"id":66848057,"last_visited_at":"2022-04-18T03:12:40Z"},{"activity_id":1507485,"activity_type":"learning_activity","completeness":"part","created_by_id":1382127,"created_for_id":1382127,"data":{"completeness":100,"end":474,"ranges":[[0,474]]},"id":66815356,"last_visited_at":"2022-04-18T03:12:38Z"},{"activity_id":1507502,"activity_type":"learning_activity","completeness":"part","created_by_id":1382127,"created_for_id":1382127,"data":{"completeness":100,"end":417,"ranges":[[0,417]]},"id":66822402,"last_visited_at":"2022-04-18T03:12:36Z"},{"activity_id":1507711,"activity_type":"learning_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{"completeness":100,"end":415,"ranges":[[0,416]]},"id":68940794,"last_visited_at":"2022-04-18T03:09:42Z"},{"activity_id":1507701,"activity_type":"learning_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{},"id":70088361,"last_visited_at":"2022-04-18T02:59:42Z"},{"activity_id":1507688,"activity_type":"learning_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{},"id":70088329,"last_visited_at":"2022-04-18T02:59:40Z"},{"activity_id":1507680,"activity_type":"learning_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{},"id":70088233,"last_visited_at":"2022-04-18T02:59:37Z"},{"activity_id":1507644,"activity_type":"learning_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{"completeness":100,"end":456,"ranges":[[0,456]]},"id":70082710,"last_visited_at":"2022-04-18T02:59:33Z"},{"activity_id":1507638,"activity_type":"learning_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{"completeness":100,"end":443,"ranges":[[0,443]]},"id":70067901,"last_visited_at":"2022-04-18T02:55:39Z"},{"activity_id":1507591,"activity_type":"learning_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{},"id":70019198,"last_visited_at":"2022-04-18T02:09:39Z"},{"activity_id":1507580,"activity_type":"learning_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{},"id":70019163,"last_visited_at":"2022-04-18T02:09:37Z"},{"activity_id":1507570,"activity_type":"learning_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{},"id":70019112,"last_visited_at":"2022-04-18T02:09:34Z"},{"activity_id":1507560,"activity_type":"learning_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{},"id":70019021,"last_visited_at":"2022-04-18T02:09:29Z"},{"activity_id":1507527,"activity_type":"learning_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{"completeness":100,"end":390,"ranges":[[0,390]]},"id":70009407,"last_visited_at":"2022-04-18T02:09:15Z"},{"activity_id":137719,"activity_type":"exam_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{"referrer_exam_id":137719,"score":100},"id":69940921,"last_visited_at":"2022-04-18T00:51:33Z"},{"activity_id":137679,"activity_type":"exam_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{"referrer_exam_id":137679,"score":100},"id":69060378,"last_visited_at":"2022-04-16T07:12:04Z"},{"activity_id":137717,"activity_type":"exam_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{"referrer_exam_id":137717,"score":100},"id":68939958,"last_visited_at":"2022-04-16T04:18:25Z"},{"activity_id":137715,"activity_type":"exam_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{"referrer_exam_id":137715,"score":100},"id":68939606,"last_visited_at":"2022-04-16T04:17:50Z"},{"activity_id":137725,"activity_type":"exam_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{"referrer_exam_id":137725,"score":100},"id":68906634,"last_visited_at":"2022-04-16T03:27:12Z"},{"activity_id":137721,"activity_type":"exam_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{"referrer_exam_id":137721,"score":100},"id":68906393,"last_visited_at":"2022-04-16T03:27:00Z"},{"activity_id":137740,"activity_type":"exam_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{"referrer_exam_id":137740,"score":100},"id":68906161,"last_visited_at":"2022-04-16T03:26:48Z"},{"activity_id":137754,"activity_type":"exam_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{"referrer_exam_id":137754,"score":100},"id":68905923,"last_visited_at":"2022-04-16T03:26:36Z"},{"activity_id":137763,"activity_type":"exam_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{"referrer_exam_id":137763,"score":100},"id":68905707,"last_visited_at":"2022-04-16T03:26:24Z"},{"activity_id":137770,"activity_type":"exam_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{"referrer_exam_id":137770,"score":100},"id":68905485,"last_visited_at":"2022-04-16T03:26:12Z"},{"activity_id":137774,"activity_type":"exam_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{"referrer_exam_id":137774,"score":100},"id":68905309,"last_visited_at":"2022-04-16T03:26:00Z"},{"activity_id":137777,"activity_type":"exam_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{"referrer_exam_id":137777,"score":100},"id":68796920,"last_visited_at":"2022-04-16T01:17:55Z"},{"activity_id":137671,"activity_type":"exam_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{"referrer_exam_id":137671,"score":100},"id":67228911,"last_visited_at":"2022-04-13T13:22:31Z"},{"activity_id":137661,"activity_type":"exam_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{"referrer_exam_id":137661,"score":100},"id":66928004,"last_visited_at":"2022-04-13T06:45:03Z"},{"activity_id":1507510,"activity_type":"learning_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{"completeness":100,"end":297,"ranges":[[0,297]]},"id":66842172,"last_visited_at":"2022-04-13T04:27:30Z"},{"activity_id":1507498,"activity_type":"learning_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{},"id":66822236,"last_visited_at":"2022-04-13T03:35:26Z"},{"activity_id":1507492,"activity_type":"learning_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{"completeness":100,"end":299,"ranges":[[0,299]]},"id":66818347,"last_visited_at":"2022-04-13T03:35:25Z"},{"activity_id":1507479,"activity_type":"learning_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{"completeness":100,"end":434,"ranges":[[0,434]]},"id":66811914,"last_visited_at":"2022-04-13T03:25:34Z"},{"activity_id":1507475,"activity_type":"learning_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{},"id":66811889,"last_visited_at":"2022-04-13T03:21:19Z"},{"activity_id":1507469,"activity_type":"learning_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{},"id":66811867,"last_visited_at":"2022-04-13T03:21:18Z"},{"activity_id":1507459,"activity_type":"learning_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{},"id":66811178,"last_visited_at":"2022-04-13T03:20:28Z"},{"activity_id":1507453,"activity_type":"learning_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{},"id":66811129,"last_visited_at":"2022-04-13T03:20:24Z"},{"activity_id":137651,"activity_type":"exam_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{"referrer_exam_id":137651,"score":100},"id":66810384,"last_visited_at":"2022-04-13T03:19:36Z"},{"activity_id":1507428,"activity_type":"learning_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{"completeness":100,"end":383,"ranges":[[0,383]]},"id":66797719,"last_visited_at":"2022-04-13T03:19:35Z"},{"activity_id":1507421,"activity_type":"learning_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{"completeness":100,"end":503,"ranges":[[0,503]]},"id":66793434,"last_visited_at":"2022-04-13T03:05:57Z"},{"activity_id":1507416,"activity_type":"learning_activity","completeness":"full","created_by_id":1382127,"created_for_id":1382127,"data":{},"id":66793361,"last_visited_at":"2022-04-13T03:01:21Z"}]}
     */
















}
